using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;
/*
 * There are many processes that handle the flows of data
 * we call them business logic of a program.
 * For each of business logic process we create a class 
 * that handle for that process
 * 
 * */
namespace BaHuan.BusinessLayer
{
	
	public class ChucVuMgt
	{
	
		public ResultObj SaveNewChucVu(ChucVu chucvu)
        		{
			ResultObj result = new ResultObj();
			chucvu.Id = -1;
			ChucVuDAO chucvuDAO = new ChucVuDAO();
			result = chucvuDAO.SaveChucVu(chucvu);
			
			return result;
		}
		
		public ResultObj UpdateChucVu(ChucVu chucvu)
        		{
			ResultObj result = new ResultObj();
			ChucVuDAO chucvuDAO = new ChucVuDAO();
			result = chucvuDAO.SaveChucVu(chucvu);
			
			return result;
		}
		
		public ResultObj DeleteChucVu(ChucVu chucvu)
        		{
			ResultObj result = new ResultObj();
			ChucVuDAO chucvuDAO = new ChucVuDAO();
			result = chucvuDAO.DeleteChucVu(chucvu);
			
			return result;
		}
		
		public ResultObj GetAllChucVu( )
        		{
			ResultObj result = new ResultObj();
			ChucVuDAO chucvuDAO = new ChucVuDAO();
			result = chucvuDAO.GetAllChucVu();
			
			return result;
		}
		
		public ResultObj GetChucVuById(ChucVu chucvu)
        		{
			ResultObj result = new ResultObj();
			ChucVuDAO chucvuDAO = new ChucVuDAO();
			result = chucvuDAO.GetAllChucVuByID(chucvu);
			
			return result;
		}
					
	}
}
